// import axios from 'axios'
import request from '../../config/request'
// const api = axios.create({
//   baseURL: 'http://localhost:8080/api'
// })

export const userApi = {
  getUsers() {
    return request.get('/api/users')
  },
  
  getUserById(id: any) {
    return request.get(`/api/users/${id}`)
  },
  
  createUser(user: any) {
    return request.post('/api/users', user)
  },
  
  deleteUser(id: any) {
    return request.delete(`/api/users/${id}`)
  },

  updateUser(id: any, user: any) {
    return request.put(`/api/users/${id}`, user)
  },
  login(data: any) {
    return request.post('/api/users/login', data)
  },
  
  register(data: any) {
    return request.post('/api/users/register', data)
  }
  // 
  
}